<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>
<%@ include file="/WEB-INF/views/shared/taglib.jsp"%>

<link rel="stylesheet" type="text/css" href="/assets/css/main.css">

<%
	String contextPath = request.getContextPath();

    String path = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort() + contextPath;
    String save_introPath="/admin/rel/relative/save_intro";
%>



<section id="introduction" class="main">

                <header class="major">
                        <h2 style="float: left;">简介</h2>
                        <div class="div-show-hover">
                            <button class="button special small " onclick="intro_edit();">编辑</button>       
                        </div>
                </header>

                
                <div id="div_intro_main">
                    
                    
                    <div class="content">
                        <p>${rel.relative_information}</p>
                    </div>
                    <dl class="alt">
                        <dt>姓名：</dt>
                        <dd>${rel.getName()}</dd>
                        <dt>职业：</dt>
                        <dd>${rel.relative_job}</dd>
                        <dt>民族：</dt>
                        <dd>${rel.relative_nation}</dd>
                        <dt>籍贯：</dt>
                        <dd>${rel.getBirthPlace()}</dd>
                        <dt>诞辰：</dt>
                        <dd>${rel.getBirthdayOfString()}</dd>
                        <div id="intro_info_isalive">
                            <dt>逝世：</dt>
                            <dd>${rel.getDeathdayOfString()}</dd>
                            <dt>葬于：</dt>
                            <dd>${rel.relative_buryAddress}</dd>
                        </div>
                    </dl>
                </div>

               
                <div id="div_intro_edit" style="display: none;" >
                    <t:form id="form_intro_edit" commandName="rel" action="<%=save_introPath%>" method="post" >
                    <div class="hide">
                        <t:hidden path="relativeId"/>
                    </div>
                        <div class="8u 12u$(medium)">

								<t:textarea rows="5" cols="5" path="relative_information" colClass="col-md-30"/>

                            
                            <div class="row uniform">
                                <div class="6u 12u$(medium)">       
                                    <dl class="alt" >
                                        <dt>姓:</dt>
                                        <dd><t:input type="text" path="relative_lastName"/></dd>
                                        <dt>名:</dt>
                                        <dd><t:input type="text" path="relative_firstName"/></dd>
                                        <dt>职业：</dt>
                                        <dd><t:input type="text" path="relative_job" /></dd>
                                        <dt>民族：</dt>
                                        <dd><t:input type="text" path="relative_nation" /></dd>
                                    </dl>
                                </div>
                                <div class="6u$ 12u$(medium)">       
                                    <dl class="alt">                                                   
                                        <dt>状态：</dt>
                                        <dd>
											<t:radiobutton path="relative_alive" value="0" onclick="deadinfo.style.display='block'">去世</t:radiobutton>	
											<t:radiobutton path="relative_alive" value="1" onclick="deadinfo.style.display='none';">健在</t:radiobutton>     
                                        </dd>
                                        <dt>生于：</dt>
                                        <dd><t:date path="relative_birthday"/></dd>
                                        <div id="deadinfo" style="display: none;">
                                            <dt>卒于：</dt>
                                            <dd><t:date path="relative_deathday"/></dd>
                                            <dt>葬于：</dt>
                                            <dd><t:input type="text" path="relative_buryAddress"/></dd>
                                        </div>
                                    </dl>
                                </div>
                                <div class="2u">
                                    <dt>籍贯：</dt>
                                </div>
                                <div class="5u">
                                    <dd>
                                        <t:input path="relative_province" />
                                    </dd>
                                </div>
                                <div class="5u$">
                                    <dd>
                                       <t:input path="relative_city"  />
                                    </dd>
                                </div>
                            </div>                     
                        </div>

                        <div class="4u$ 12u$(medium)" style="padding: auto;">
                            <span class="image" style="float: left;padding: auto;">
                                <img src="${rel.relative_file}images/photo.jpg" alt=""/>
                            </span>
                            

                            <input type="file" path="path" class="file-input">      

                        </div>
                        <div style="padding-top: 10px;">
                            <input type="submit" class="button special small"  value="保存">
                            <input type="cancel" class="button small" onclick="intro_cancel();" value="取消">
                        </div>
                    </t:form>
                </div>

        </section>




<script type="text/javascript">
    var div1=document.getElementById("intro_info_isalive");
    if(${rel.relative_alive}=="1"){
        div1.style.display="none";
    }else{
        div1.style.display="block";
    }

    
</script>

<script type="text/javascript">
    var div2=document.getElementById("div_intro_main");
    var div3=document.getElementById("div_intro_edit");

    function intro_edit(){
        div2.style.display="none";
        div3.style.display="block";
    }

    function intro_save(){
        div2.style.display="block";
        div3.style.display="none";
        //var form_1=document.getElementById("form_intro_edit");
        //form_1.submit();
        $("#form_intro_edit").submit();   
    }

    function intro_cancel(){
        div2.style.display="block";
        div3.style.display="none";  
        $("#form_intro_edit").cancel();           
    }
</script>



<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/uploaders/uploaders.jsp"%>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/pages/fileUploader/uploader_bootstrap.jsp"%>
